# `define`

A component can be created via Javascript with `mask.define`, but also directly in the Mask markup.

```mask
define COMPONENT_NAME as (WRAPPER_DEFINITION) extends REF_1, REF_2, REF_N {
	function PROPERTY (ARGUMENTS) {
		// javascript syntax
	}
	function PROPERTY_N (ARGUMENTS) {

	}

	slot SLOT_NAME (sender) {
		// javascript syntax
	}

	var SCOPE_NAME = 'FOO'; /*String, Number, Object, Array*/

	'Any other initial components nodes';
}
```

##### With model mapping
The current model and the scope is transformed into the new model object for the component.
```mask
define COMPONENT_NAME (ARG_1, ARG_2, ARG_N) {
	'Sample: ~ARG_1.PROPERTY'
}
```


## `1` Nodes

Childnodes sets nodes the component will have. :exclamation: If then later the component will have other nodes, this initial nodes will be merged with them.

```mask
define COMPONENT_NAME {

}
```

----
:checkered_flag: